###########################################
#Makefile for simple programs
###########################################
INC= -I ./ -I /usr/include/mysql/ 
LIB= -L /usr/lib/mysql -l mysqlclient -lpthread -lm

CC=gcc
CC_FLAG=-Wall -g

PRG=main
OBJ=main.o epoll_op.o file_op.o db_op.o task_cycle.o cJSON.o


$(PRG):$(OBJ)
	$(CC) -o $@ $(OBJ) $(INC) $(LIB)
.SUFFIXES: .c .o  
.c.o:  
	$(CC) $(CC_FLAG) $(INC) -c $*.c -o $*.o

.PRONY:all clean
clean:
	@echo "Removing linked and compiled files......"
	rm -f $(OBJ) $(PRG)

